package com.jollychic.www.roomdatebasedemo.model;

import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.ForeignKey;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;

import static android.arch.persistence.room.ForeignKey.CASCADE;

/**
 * desc:  <br/>
 * author: 李超杰 <br/>
 * date: 2018/5/7 下午8:46 <br/>
 * since v <br/>
 */
@Entity(tableName = "Goods", foreignKeys = @ForeignKey(entity = StoreEntity.class
        , parentColumns = "storeId"
        , childColumns = "store_id"
        , onDelete = CASCADE))
public class GoodEntity {

    @PrimaryKey
    @NonNull
    @ColumnInfo(name = "goodId")
    public String goodId;
    public String name;


    //对应的店铺
    @ColumnInfo(name = "store_id")
    public String storeId;


    public GoodEntity() {
    }

    @NonNull
    public String getGoodId() {
        return goodId;
    }

    public void setGoodId(@NonNull String goodId) {
        this.goodId = goodId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }
}
